package Dome4;

public class Text4 {
    public static void main(String[] args) {
        A a=new B();
        a.a();
    }
}

class A{
    public void a(){
        ab();
    }
    public void ab(){
        System.out.println("class A的方法");
    }
}

class B extends A{
  public void ab(){
      System.out.println("class B的方法");
  }
}
